<html>
<head><meta charset="utf-8"><title>merging cargo check and RA diagnostics · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/merging.20cargo.20check.20and.20RA.20diagnostics.html">merging cargo check and RA diagnostics</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219771259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/merging%20cargo%20check%20and%20RA%20diagnostics/near/219771259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/merging.20cargo.20check.20and.20RA.20diagnostics.html#219771259">(Dec 13 2020 at 17:40)</a>:</h4>
<p>With us implementing more and more diagnostics natively, we should probably think about how to avoid having duplicates from cargo check all the time? Maybe we could define for each native diagnostic which rustc error code corresponds to it, and then merge them on the IDE level if the rustc diagnostic is there as expected. Might be more complicated than that because of differing spans though. Or does no-one else consider this a problem? <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="219771550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/merging%20cargo%20check%20and%20RA%20diagnostics/near/219771550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/merging.20cargo.20check.20and.20RA.20diagnostics.html#219771550">(Dec 13 2020 at 17:47)</a>:</h4>
<p>I think we should definitelly assign error codes to our diagnostics, and make sure that they match with rustc ones</p>



<a name="219771593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/merging%20cargo%20check%20and%20RA%20diagnostics/near/219771593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/merging.20cargo.20check.20and.20RA.20diagnostics.html#219771593">(Dec 13 2020 at 17:48)</a>:</h4>
<p>We probably should impelment some diagnostic merging logic as well, but I am the wrong person to access urgency here -- I don't use <code>cargo check</code></p>



<a name="219771605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/merging%20cargo%20check%20and%20RA%20diagnostics/near/219771605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/merging.20cargo.20check.20and.20RA.20diagnostics.html#219771605">(Dec 13 2020 at 17:48)</a>:</h4>
<p>As a pre-requsite, it'd be good to refactor the code that maps JSON diagnostic to LSP -- I feel like it could be simplified quite a bit</p>



<a name="219783036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/merging%20cargo%20check%20and%20RA%20diagnostics/near/219783036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/merging.20cargo.20check.20and.20RA.20diagnostics.html#219783036">(Dec 13 2020 at 21:44)</a>:</h4>
<p>Yeah that code is a little complicated</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>